<script setup lang="ts">
import {getCurrentInstance} from 'vue'
import {useRoute, useRouter} from 'vue-router'

// import openAldMixin from '@/base/mixins/openAldMixin'

// const {tokenFromAld} = openAldMixin({});
// tokenFromAld('poineer','-1',{},'','');

const {proxy} = getCurrentInstance();
const router = useRouter();
const route = useRoute();
const goPath = (page: string) => {
  router.push({path: page})
}


// 加载圈使用案例
// proxy.$loading.open();//不传，默认展示 加载中
// proxy.$loading.open({message:'loading 时间：5秒....'});
// setTimeout(() => {
//   // 关闭加载圈使
//   proxy.$loading.close();
// }, 5000);

// //全局挂载toast函数式组件
// proxy.$toast('保存成功');

//确认对话框
// proxy.$confirmDialog({ message: '如果解决方法是丑陋的，那就肯定还有更好的解决方法，只是还没有发现而已。' })

// //弹框
// proxy.$dialog({title: '温馨提示', message: '保存成功' });

// 通知信息组件
// proxy.$notify('提交成功');

// 异步请求axio;
// proxy.$http.get('/xsb/ability/businessLimit/h5QryBusiPermission').then(()=>{window.alert('adfadf')})


</script>

<template>
  <div class="main-box">
    <div>
      <RouterView v-slot="{ Component }">
        <keep-alive>
          <component :is="Component" :key="route.name" v-if="route.meta.keepAlive"/>
        </keep-alive>
        <component :is="Component" :key="route.name" v-if="!route.meta.keepAlive"/>
      </RouterView>
    </div>
  </div>

</template>

<style scoped>
.main-box {
  width: 100vw;
  height: 100%;
  top: 0;
  bottom: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  position: fixed;
  display: flex;
  flex-direction: column;
}

.main-box > div {
  overflow: auto;
  height: 100%;
}

.openVconsole-box {
  position: fixed;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  z-index: 77777777;
}

.openVconsole-box2 {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  z-index: 7777777;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
